/**
 * 
 */
package ac.technion.StreamMania.connectivity.iface;

import ac.technion.gcframework.membership.Member;

/**
 * This interface defines the behavior needed by the callback that is given to application layer that tops our stack.
 * This application layer will notify us about new messages, joining/leaving members and identified
 * connections/disconnections.
 * 
 * In addition, the interface contains functions that handle all different messages that are sent
 * by the sender to the receivers.
 * 
 * @author advinsky (original)
 * @author Arnony (extended)
 * 
 */
public interface INetworkListener
{
	void memberJoined(Member member, String name, boolean isSender);
	void memberLeft(Member member);
	void memberDisconnected(Member member);
	void memberReConnected(Member member);
	
	public void handleNewStream(String fileName, long lengthInKb, long lengthInSeconds);
	public void handleReceivedMedia(byte[] receivedMedia, int counter);
	public void handlePause();
	public void handleContinue();
	public void handleSenderStopped();
	public void handleSenderFinished();
}